package com.tony.ai.adapter

import com.tony.ai.bean.ColorBean
import com.tony.ai.databinding.ItemBackgroundColorBinding

class BackgroundColorAdapter(var onItemClick:(pos:Int, item: ColorBean)->Unit):
    BaseListAdapter<ColorBean,ItemBackgroundColorBinding>(ItemBackgroundColorBinding::inflate) {
    override fun bind(binding: ItemBackgroundColorBinding, item: ColorBean, position: Int) {
        binding.tvBackgroundColor.setBackgroundColor(item.color)
        binding.root.setOnClickListener {
            onItemClick(position,item)
        }
    }
}